package com.maiji.cloud.service.impl;

import com.maiji.cloud.entities.manager.Menu;
import com.maiji.cloud.mapper.MenuMapper;
import com.maiji.cloud.service.MenuService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.maiji.cloud.util.UserUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements MenuService {

    @Autowired
    MenuMapper menuMapper;

    @Override
    public List<Menu> findAllMenusByUserId() {
        return menuMapper.findAllMenusByUserId(UserUtil.getCurrentUser().getUuId());
    }
}
